<!--
 * @FilePath     : /study_code/html/input-number.html
 * @Description  : input number 属性
 * @Date         : 2025-04-26 08:06:05
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-26 08:06:09
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="" />
  </head>
  <body>
    <input type="number" id="userId" class="keyword" placeholder="用户id" />
    <script>
      userId.onkeypress = function (event) {
        console.log('值1', event.keyCode)
        console.log('值2', String.fromCharCode(event.keyCode))
      }
    </script>
  </body>
</html>
